made code DRYer, and got rid of unnecessary src