refactor, fixes..