Refactored python code. Added "AgeClass" feature