Reduce some redundancy
s/P/PERIOD/
Merge pull request #1 from Fuuzetsu/massive-refactoring

Even prettier code!