Refactor tmx map loading