refactor me, please!