Homepage: Refactored JS