refactor minor stuff