Refactor code, change arrays into objects; so far so good