The code is rushed and messy. If you have any improvements feel free to contribute better design patterns.