Splits logic into multiple files for readability