Everything is now working + refactored code