slightly cleaner code