Optimize layout and code cleanup...

Signed-off-by: pyramid-X <rdxperiaz@gmail.com>