Refactor and fix flxCamera