refactor more stuff