Making function prototypes a bit smoother and misc tiny changes