updated for cleaner code