Small fixes and refactor