separate logic