separate logic into functions, variables