Refactored into different files