got rid of repetitive functions in maps setup