Reduced magic numbers; better naming of helper methods.