Some minor refactorings. constants added to input lib (propably will wipe that >_< )