Organized functions a bit