auto-generate console methods
use ternary
Merge pull request #6 from dciccale/master

Make code shorter