Refactored some core functions