Fixed bug loading + more refactor