moves out helper functions